import cv2
import numpy as np


def read_depth(depth_path):
    depth = cv2.imread(depth_path, cv2.CV_16UC1)  # unit: mm
    depth = np.float32(depth) / 1000  # unit: m
    return depth


if __name__ == "__main__":
    depth_path = "/localdata_sdd/HOI4D_Sim/ZY20210800002/H2/C2/N10/S28/s05/T1/depth/00200.png"
    depth = read_depth(depth_path)
    print(depth.shape, np.min(depth[600:700, 900:1000]), np.max(depth[600:700, 900:1000]))
